package com.streamsets.datacollector.pileline.enums;

/**
 * @author wengzhonghui
 * @date 2019/10/16 19:04
 */
public enum HiveHadoopFSConfigEnum {

    // 例如：hdfs://172.30.0.84:8020
    hdfsUri("hdfsTargetConfigBean.hdfsUri","10"),
    maxRecordsPerFile("hdfsTargetConfigBean.maxRecordsPerFile",""),
    maxFileSize("hdfsTargetConfigBean.maxFileSize",""),
    idleTimeout("hdfsTargetConfigBean.idleTimeout","10"),
    lateRecordsLimit("hdfsTargetConfigBean.lateRecordsLimit","10"),
    dataFormat("hdfsTargetConfigBean.dataFormat","AVRO");


     HiveHadoopFSConfigEnum(String name, Object defaultValue) {
        this.name = name;
        this.defaultValue = defaultValue;
    }
    private String name;

    private Object defaultValue;

    public static HiveHadoopFSConfigEnum valueOfName(String name){
        for(HiveHadoopFSConfigEnum type : HiveHadoopFSConfigEnum.class.getEnumConstants()){
            if (name.equalsIgnoreCase(type.getName())){
                return type;
            }

        }
        throw new IllegalArgumentException("name:" + name + " is not a valid "
                + "Types.java value.");
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Object getDefaultValue() {
        return defaultValue;
    }

    public void setDefaultValue(Object defaultValue) {
        this.defaultValue = defaultValue;
    }
}
